import type { MockConfig, MockMethod } from "vite-plugin-mock";
import Mock from "mockjs";

import { exampleSongs } from "./songs-data.ts";

import baseResponse from "./base";

export default (config?: MockConfig) => {
  return [
    {
      url: "/api/getSongsUrl",
      method: "get",
      response: ({ body }: { body: any }) => {
        const data = {
          songs: exampleSongs,
        };
        return baseResponse.success(data);
      },
    },
  ] as MockMethod[];
};
